package sky.dao.Impl;

import org.springframework.stereotype.Repository;
import sky.dao.CityDAO;
import sky.domain.City;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Gauss
 * Date: 19.05.13
 * Time: 17:28
 * To change this template use File | Settings | File Templates.
 */
@Repository
public class CityDAOImpl extends AbstractDAOImpl<City> implements CityDAO {

    @Override
    @SuppressWarnings("unchecked")
    public List<String> autocompleteList(String autocompleteString) {
        return template.find("select name from City as city where city.name like  ''||?||'%'", autocompleteString);
    }

    @Override
    protected Class<City> getDomainClass() {
        return City.class;
    }
}
